<?php

class Person
{
    var $name;

    /**
     * @return mixed
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @param mixed $name
     */
    public function setName($name): void
    {
        $this->name = $name;
    }

}

class User123
{
    var $name;
    var $age;
    var $password;

    var $person;

    /**
     * @return mixed
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @param mixed $name
     */
    public function setName(string $name): void
    {
        $this->name = $name;
    }

    /**
     * @return mixed
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * @param mixed $password
     */
    public function setPassword(string $password): void
    {
        $this->password = $password;
    }

    /**
     * @return mixed
     */
    public function getAge()
    {
        return $this->age;
    }

    /**
     * @param mixed $age
     */
    public function setAge(int $age): void
    {
        $this->age = $age;
    }

    /**
     * @return mixed
     */
    public function getPerson()
    {
        return $this->person;
    }

    /**
     * @param mixed $person
     */
    public function setPerson(Person $person): void
    {
        $this->person = $person;
    }


}

/*$user123 = new User123();
$user123->setName("我是爸爸");
//echo $user123->getName();
echo $user123->getAge();*/

$data = [
    "age" => 1,
    "name" => "我是爸爸",
    "password" => "我是123",
    "person" => [
        "name" => 123,
    ]
];

//$ref=new ReflectionObject(Person::class);
//var_dump($ref);
$classname = 'Person';
$ref=new ReflectionClass($classname);
var_dump($ref);